Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ensureLink/ensureLinkSync for fs #353

Merged
merged 4 commits into from
Apr 22, 2019
Merged

Conversation

axetroy
Copy link
Contributor

@axetroy axetroy commented Apr 22, 2019

part of #261.
ref: #268.

@axetroy axetroy mentioned this pull request Apr 22, 2019
13 tasks
const destFilePathType = getFileInfoType(destStatInfo);
if (destFilePathType !== PathType.file) {
throw new Error(
`Ensure path exists, expected 'file', got '${destFilePathType}'`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard links don't have a specific type, so we can only use it as file.

* Ensures that the hard link exists.
* If the directory structure does not exist, it is created.
*
* @param src the source file path. directory are not allow.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hard link does not support for the directory.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a TODO and/or issue for this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the system not support. This is not possible.

https://askubuntu.com/questions/210741/why-are-hard-links-not-allowed-for-directories

So I think todo is meaningless

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. I didn’t know that.

Please change “directory are not allow” to “Directory hard links are not allowed”

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok. I didn’t know that.

Please change “directory are not allow” to “Directory hard links are not allowed”

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ry ry merged commit 45eebed into denoland:master Apr 22, 2019
@axetroy axetroy deleted the ensure_link branch April 22, 2019 15:36
ry pushed a commit to ry/deno that referenced this pull request Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants